<?php
defined('SEJUJOPEFDNGJSL') or exit('Access denied');

$tmp_arr['toption'].='<a href="/ucenter/main.php?lsaction=articlelist" class="'.geteqval(array($option,1,'taselbtn','thabtn')).'">返回文章列表</a><input type="submit" name="submit" value="添加" class="thabtn">';

if($_POST['submit']=='添加'){
	$arr['title']=checkstr($_POST['title']);
	$arr['attype']=checkstr($_POST['attype']);
	$arr['is_on_top']=intval($_POST['is_on_top']);
	$arr['view_times']=intval($_POST['view_times']);
	$arr['author']=checkstr($_POST['author']);
	$arr['content']=addslashes($_POST['editor01']);
	$arr['art_time']=strtotime($_POST['art_time']);
	$sql = getinsertsql($arr,'ld_article');
	$db->sitedbexec($sql);
	record_log("添加文章",0);
	msg_l("添加成功 ","/ucenter/main.php?lsaction=articlelist");
}
?>
<h3><?php echo getmenu($GLOBALARR['menu'],'articleadd')?></h3>
<form method="post" action="<?=geturl()?>">
	<div class="main-r-item" ><?=$tmp_arr['toption']?></div>
	<table class=" ttab">
		<tbody>
			<tr>
				<td>文章标题</td>
				<td><input style="color:#333" type="text" name="title" id = "artit"/></td>
			</tr>
			<tr>
				<td>文章类型</td>
				<td>
					<?=getatricletype(array(3,2));?>
				</td>
			</tr>
			<tr>
				<td>是否置顶</td>
				<td>
					<input type="radio" name="is_on_top" value="0" /> 否
					<input type="radio" name="is_on_top" value="1" checked="checked" /> 是
				</td>
			</tr>
			<tr>
				<td>浏览次数</td>
				<td><input style="color:#333" type="text" name="view_times" id = "view_times" value="0"/></td>
			</tr>
			<tr>
				<td>发布人</td>
				<td><input style="color:#333" type="text" name="author" id = "author"/></td>
			</tr>
			<tr>
				<td>发布时间</td>
				<td><input style="color:#333" type="text" name="art_time" id = "art_time" value = "<?php echo date("Y-m-d H:i:s")?>"/></td>
			</tr>
		</tbody>		
	</table>
	<div class = "editor">
		<textarea rows="10" cols="20" name="editor01" id="editor01">请输入.</textarea>
	</div>
</form>
<script type="text/javascript">
var ue = UE.getEditor('editor01',{
	initialFrameWidth:1000,
	initialFrameHeight:400
});
</script>